package B;

import java.util.concurrent.Callable;

/**
 * @Author czl
 * @Date 2024-03-20
 */
public class SumThread implements Callable<Integer> {

    private int m ;
    private int n ;

    public SumThread(int m , int n){
        this.m = m;
        this.n = n;
    }

    private SumThread()
    {

    }
    @Override
    public Integer call() throws Exception {
        int sum = 0;
        for (int i = m; i <= n; i++) {
            sum+=i;
        }
        return sum;
    }
}
